1 <?php
2  session_start();
3  
if(isset($_SESSION['user']))
4  {
5
6  }
7  
else{
8   echo
"<script>location.href='login.html'</script>";
9  }
10 ?>
11 <html>
12     <head>
13         <title>Saledetails </title>
14         <style>
15
16             body {
17   margin:
0;
18   font-family: Arial, Helvetica, sans-serif;
19   background: #
484848;
20 }
21 .topnav {
22   overflow: hidden;
23   background-color: rgba(
249, 105, 14, 1);
24   height: 70px;
25   border: 3px solid #e69500;
26 }
27
28 .topnav a {
29   
float: left;
30   color: #f2f2f2;
31   text-align: center;
32   padding: 14px 16px;
33   text-decoration: none;
34   font-size: 35px;
35   font-weight: bold;
36 }
37
38 .topnav-right {
39   
float: right;
40 }
41 table {
42     font-family: arial, sans-serif;
43     border-collapse: collapse;
44     outline:#e69500 solid 5px;
45     background: #FAFAFA;
46     width:
100%;
47     margin:5px ;
48     
49 }
50
51 td, th {
52     border: 1px solid #dddddd;
53     text-align: left;
54     padding: 8px;
55 }
56 th{
57     background-color:rgba(
249, 105, 14, 1);
58 }
59
60
61 .custombutton{
62   margin:25px;
63   
64 }input[type=text] {
65     width:
20%;
66     padding: 12px 20px;
67    margin:8px ;
68     border: 2px solid red;
69     background:transparent;
70     color:#
000000;
71 }
72     </style>
73 </head>
74 <body>
75 <div
class="topnav">
76             <a
class="active" href="home.html"><img src="ic_add_pet.png"></a>
77             <a href=
"sales.php">Sales details</a>
78             <div
class="topnav-right">
79               <a href=
"logout.php">logout</a>
80             </div>
81           </div>
82           <div
class="custombutton">
83 <form>
84 <button style=
" height: 50px;width: 120px;cursor:pointer;border-radius:15px;
85 border: 3px solid #e69500;background-color: rgba(
249, 105, 14, 1);color:#f2f2f2;font-size:14px; " formaction="salesadd.php">Add new details</button>
86 <button style=
"height: 50px;width: 110px;cursor:pointer;border-radius:15px;
87 border: 3px solid #e69500;background-color: rgba(
249, 105, 14, 1);color:#f2f2f2;font-size:14px;" formaction="salesupdate.php">update details</button>
88 <button style=
"margin-left:800px; height: 50px;width: 110px;cursor:pointer;border-radius:15px;
89 border: 3px solid #e69500;background-color: rgba(
249, 105, 14, 1);color:#f2f2f2;font-size:14px;" formaction="soldproducts.php">sold products</button>
90 <button style=
"height: 50px;width: 100px;cursor:pointer;border-radius:15px;
91 border: 3px solid #e69500;background-color: rgba(
249, 105, 14, 1);color:#f2f2f2;font-size:14px;" formaction="soldpets.php">sold pets</button>
92 </form>
93 </div>
94 <?php
95    
96 $con = mysqli_connect(
"localhost","root","","Petshop_management");
97 if
(!$con)
98 {
99 die(
"could not connect".mysql_error());
100 }
101 $
var=mysqli_query($con,"select * from sales_details ");
102 echo
"<table border size=10>";
103 echo
"<tr>
104 <th>sd_ID</th>
105 <th>cs_id</th>
106 <th>date</th>
107 <th>total</th>
108 </tr>"
;
109 if
(mysqli_num_rows($var)>0){
110     
while($arr=mysqli_fetch_row($var))
111     { echo
"<tr>
112     <td>$arr[
0]</td>
113     <td>$arr[
1]</td>
114     <td>$arr[
2]</td>
115     <td>$arr[
3]</td>
116     </tr>"
;}
117     echo
"</table>";
118     mysqli_free_result($
var);
119 }
120
121 mysqli_close($con);
122     
123     
124 ?>
125 <form action=
"deletesales.php" method="post">
126 <input id=
"dbutton" type="text" name="t1" placeholder="Enter the id to delete" required >
127 <input style=
"width:75px;height:44px;cursor:pointer;border-radius:15px;
128 border: 3px solid #e69500;background-color: rgba(
249, 105, 14, 1);color:#f2f2f2;font-size:15px;"type="submit" value="Delete">
129 </form>
130
131 </body>
132 </html>


Gõ tìm kiếm nhanh...